﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

using System.ComponentModel;
using UnitVariables;
using System.Reflection;


namespace UnitVaribGuiTest
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        Data dc = new Data();

        public MainWindow()
        {
            InitializeComponent();
            mainGrid.DataContext = dc;
        }

        private void UVC_LostFocus(object sender, RoutedEventArgs e)
        {
            dc.Update();
        }
    }

    public class Data : BaseData
    {
        private UnitVarib hold = new UnitVarib(15.2, "m");
        public UnitVarib Hold
        {
            get
            {
                return hold; }
            set 
            {
                hold = value;
                Update();
            }
        }

        private UnitVarib ger = new UnitVarib(10, "s");
        public UnitVarib Ger
        {
            get { return ger; }
            set 
            { 
                ger = value;
                Update();
            }
        }

        private UnitVarib z = new UnitVarib(0, "m/s");
        public UnitVarib Z
        {
            get
            {           
                return hold / ger;
            }
        }

    }

}
